package com.net.lnk.dubbo.user.client.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.net.lnk.dubbo.user.api.UserService;
import com.net.lnk.dubbo.user.api.response.UserDTO;

@RestController
public class UserController {

	@Reference(version = "1.0.0", loadbalance = "roundrobin")
	private UserService userService;

	@GetMapping("/user/{id}")
	public UserDTO getUser(@PathVariable Long id) {

		return userService.getById(id);
	}

}
